/* history.js */

import http from "@/utils/http";

export const historyApi = {
  /**
   * 记录历史记录
   */
  recordPersonalHistoricalRecords(data) {
    return http.post("personalRecord/v1/historys/recordPersonal", data);
  },
  /**
   * 获取对应历史记录的前五个
   */
  obtainTheHistoricalRecordsTo5ThroughTheUserId() {
    return http.get("/personalRecord/v1/historys/getHistoryRecordTo5");
  },
  /**
   * 获取用户当年所有历史记录
   */
  obtainTheCurrentYearsHistoricalRecords() {
    return http.get(
      "/personalRecord/v1/historys/getHistoryRecordToCurrentYear"
    );
  },
  /**
   * 通过历史标题搜索历史记录
   */
  searchHistoryByTitle(title) {
    return http.get("/personalRecord/v1/historys/searchHistoryByTitle", title);
  },
  /**
   * 用户批量删除历史记录
   */
  deleteInBatches(data) {
    return http.post("/personalRecord/v1/historys/deleteInBatches", data);
  },
  /**
   * 删除单个历史记录
   */
  deleteOneByOne(id) {
    return http.get("/personalRecord/v1/historys/deleteOneByOne", id);
  },
  /**
   * 清空历史
   */
  deleteAll() {
    return http.get("/personalRecord/v1/historys/deleteAll");
  }
};